<?php
/**
 * Created by PhpStorm.
 * User: tjjs
 * Date: 17-7-20
 * Time: 下午12:36
 */

namespace ActionsHttp;

use Data\Restaurant_DAO;

class ConsumerGetRestaurantInfo extends BaseActionHttp
{
    public function doAction() {
        parent::doAction();
        // 商铺id
        $restaurant_id = (int)$this->data[RESTAURANT_ID];
        // 商铺记录
        $restaurant_record = Restaurant_DAO::getRecord($restaurant_id);
        if (!$restaurant_record) {
            return $this->SendErrMsg("没有该商铺记录");
        }

        // 返回数据
        $this->setValue(RESTAURANT_INFO,$restaurant_record->getArray());
        $this->ResponseDataToCurrentClient();
    }
}